type Doctors = {
  id: number,
  name: string,
}
// 处理数据
export const setDataSource = (source: any[], length: number, cur: Doctors[]) => {
  // 源数据少于 10条
  if(source.length < length) {
    cur = source
  } else {
    // 大于的话 就取前10条
    for(let i = 0; i < length; i++) {
      cur.push({
        id: source[i].id,
        name: source[i].name
      })
    }
  }
  

  return cur
}